Skip to content

USB Device Descriptor Max Power is not configurable #504 #505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2025

Conversation

Props3D
Copy link
Contributor

@Props3D Props3D commented Mar 8, 2025

Looking at Adafruit_USBD_Device.cpp, there's a define macro for the Max Power but it's never used.

at line 85:

#ifndef USB_CONFIG_POWER
#define USB_CONFIG_POWER 100
#endif

At line 186, the power is hardcoded to 100:

  uint8_t const dev_cfg[sizeof(tusb_desc_configuration_t)] = {
      TUD_CONFIG_DESCRIPTOR(1, 0, 0, sizeof(tusb_desc_configuration_t),
                            TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP | TU_BIT(7),
                            100),
  };

I simply replaced the 100 with USB_CONFIG_POWER.

Replacing hardcoded value with define macro
@SmittyHalibut
Copy link

I almost added this change to #493 too. I like it.

Copy link
Member

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you

@hathach hathach merged commit cdc07c1 into adafruit:master May 22, 2025
12 checks passed
@Props3D
Copy link
Contributor Author

Props3D commented May 22, 2025

Thanks for merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants